;(function(){
    angular.module('app')
        .factory('userInfoService', userInfoService);

    userInfoService.$inject = [ '$window' ];
    function userInfoService( $window ) {
        var Fac = {
            checkLogined: checkLogined,
            login: login,
            logout: logout
        };

        function checkLogined() {
            if($window.localStorage.getItem("user") === "true"){
                return true;
            }
            return false;
        }

        function login() {
            $window.localStorage.setItem("user","true");
            return true;
        }

        function logout() {
            $window.localStorage.removeItem("user");
            return true;
        }
        return Fac;
    }
})();